import java.util.ArrayList;

public class findContinuousSequence {
    // 双指针+滑动窗口
    public int[][] _findContinuousSequence(int target) {
        List<int[]> list = new ArrayList<>();
        int left = 1;
        int right = 2;

        while (left < right) {
            int sum = (right - left + 1) * (left + right) / 2;

            if (sum == target) {
                int[] tmp = new int[right - left + 1];

                for (int i = 0; i < tmp.length; i++) {
                    tmp[i] = i + left;
                }
                list.add(tmp);

                left++;
            } else if (sum < target) {
                right++;
            } else {
                left++;
            }
        }
        return list.toArray(new int[list.size()][]);
    }

}
